<?php 
	$shiftId = trim($_GET['shiftId']);
	$type = trim($_GET['type']);
	$classRoom = trim($_GET['classRoom']);
	$day = trim($_GET['day']);
	$begHour = trim($_GET['begHour']);
	$endHour = trim($_GET['endHour']);
	

	try{
		$db = new mysqli('localhost','root','','fiuba');
	}catch(Exception $ex){
		echo "error: ";
	}
	
	header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past
	header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
	header ("Pragma: no-cache");
	//header ("Content-type: application/xml"); //uncomment this line if you plan to send XML

	//...................
	//echo "you should see now random numbers in your browser:".rand();
	
	if (mysqli_connect_errno())
	{
		echo 'pucha error!';
		exit;
	}
	
	echo "('$shiftId','$type','$classRoom','$day','$begHour','$endHour')";
	$query = "insert into fiuba.schedule values
				(NULL,'$shiftId','$type','$classRoom','$day','$begHour','$endHour')";
				
	$db->query($query);			
	$db->close();
		
?>

 



